<!DOCTYPE HTML>
<!-- 
This test checks that when overlay scrollbars are repositioned due to
accelerated overflow scrolling, that their position accounts for any
intervening, composited ancestors. The test is working correctly if the
scrollbars are correctly positioned on top of the scroller and the scrolled
contents.
-->
<script>
if (window.internals) {
    internals.useMockOverlayScrollbars();
    internals.settings.setPreferCompositingToLCDTextEnabled(true);
}
</script>
<style>
#scroller {
    overflow: scroll;
    width: 100px;
    height: 100px;
    border: 1px solid black;
}

.scrolled {
    background: blue;
    width: 60px;
    height: 40px;
    margin: 4px;
    position: relative;
}

#fixed {
    background: green;
    position: fixed;
    left: 60px;
    top: 60px;
    width: 80px;
    height: 80px;
}

#intervening {
    background: papayawhip;
    width: 300px;
    height: 300px;
    backface-visibility: hidden;
    margin: 90px;
}
</style>
<div id="intervening">
    <div id="scroller">
        <div id="fixed"></div>
        <div class="scrolled"></div>
        <div class="scrolled"></div>
        <div class="scrolled"></div>
        <div class="scrolled"></div>
    </div>
</div>
<script>
if (window.testRunner)
    testRunner.dumpAsTextWithPixelResults();

onload = function() {
    if (window.internals && window.testRunner)
        testRunner.setCustomTextOutput(internals.layerTreeAsText(document));
};
</script>
